#!/bin/sh
#######################################################################
# Begin httpd
#
# Description : Start Apache Web Server
#
# Author      : DJ Lucas - dj@linuxfromscratch.org
#               Bruce Dubbs - bdubbs@linuxfromscratch.org
#
# Version     : BLFS 7.0
#
########################################################################

### BEGIN INIT INFO
# Provides:            httpd
# Required-Start:      $network
# Should-Start:        networkmanager php-fpm wicd
# Required-Stop:       $network
# Should-Stop:         networkmanager php-fpm wicd
# Default-Start:       3 4 5
# Default-Stop:        0 1 2 6
# Short-Description:   Apache HTTP Server
# Description:         Controls the Apache HTTP Daemon
# X-LFS-Provided-By:   BLFS
### END INIT INFO

. /lib/lsb/init-functions

#$LastChangedBy: dj $
#$Date: 2019-09-08 13:50:13 -0500 (Sun, 08 Sep 2019) $

case "$1" in
   start)
      log_info_msg "Starting Apache HTTP daemon..."
      mkdir -p /var/run/httpd
      start_daemon /usr/sbin/apachectl -k start
      evaluate_retval
      ;;

   stop)
      log_info_msg "Stopping Apache HTTP daemon..."
      start_daemon /usr/sbin/apachectl -k stop
      evaluate_retval
      ;;

   restart)
      log_info_msg "Restarting Apache HTTP daemon..."
      start_daemon /usr/sbin/apachectl -k restart
      evaluate_retval
      ;;

   status)
      statusproc /usr/sbin/httpd
      ;;

   *)
      echo "Usage: $0 {start|stop|restart|status}"
      exit 1
      ;;
esac

# End /etc/init.d/httpd
